<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>axios常用配置</title>
    <script src="https://cdn.bootcdn.net/ajax/libs/axios/0.27.2/axios.min.js"></script>
  </head>
  <body>
    <button>测试配置</button>
    <script>
      const button = document.querySelector('button');
      button.onclick = function () {
        axios({
          url: '/delay-server/abc',
          method: 'post',
          params: {a: 1, b: 2},
          data: {c: 3, d: 4},
          headers: {  // 请求头
            e: 'atguigu'
          },
          timeout: 6000,  // 超时时间
          baseURL: 'http://localhost:8081' // 基础路径
        })
      }
    </script>
  </body>
</html>
